name = input()
payments_hour = float(input())
working_time = float(input())
if working_time <= 50:
    total_payments = payments_hour*working_time
else:
    total_payments = payments_hour*50 + payments_hour*1.6*(working_time-50)
print(f'{name},{working_time:.1f},{total_payments:.1f}')